package com.weijian.controller.admin;

import com.weijian.common.pojo.CommonResult;
import com.weijian.service.UploadService;
import jakarta.annotation.security.PermitAll;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * word文件上传和解析
 */
@RestController
@RequiredArgsConstructor
public class UploadController {

    final UploadService uploadService;

    @PostMapping("/parse")
    @PermitAll
    public CommonResult<String> parseFiles(@RequestParam("files") List<MultipartFile> files) {
        return uploadService.parseFiles(files);
    }
}
